﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CompareOptionList.cs" company="SmartPlan">
//   SmartPlan 2011
// </copyright>
// <summary>
//   The compare option list.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace DbDiff.Common.Comparer
{
    using System.Collections.Generic;
    using System.Runtime.Serialization;

    /// <summary>
    /// The compare option list
    /// </summary>
    [CollectionDataContract(Name = "CompareOptionList")]
    public class CompareOptionList : List<CompareOption>
    {
        /// <summary>
        /// Set a value by name
        /// </summary>
        /// <param name="name">
        /// The name of the compare option
        /// </param>
        /// <param name="compareOption">
        /// The compare option.
        /// </param>
        public void SetValueByName(string name, string compareOption)
        {
            int i = this.FindIndex(z => z.Name == name);
            if (i > -0)
            {
                this[i].Value = compareOption;
            }
        }
    }
}
    
